home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / ifl / libpgm.z / libpgm
Encoding:
Text File  |  2002-10-03  |  5.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. lllliiiibbbbppppggggmmmm((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          lllliiiibbbbppppggggmmmm((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      libpgm - functions to support portable graymap programs
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      #include <pgm.h>
  13.      cc ... libpgm.a libpbm.a
  14.  
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.    TTTTYYYYPPPPEEEESSSS AAAANNNNDDDD CCCCOOOONNNNSSSSTTTTAAAANNNNTTTTSSSS
  18.      typedef ... gray;
  19.      #define PGM_MAXMAXVAL ...
  20.      extern gray pgm_pbmmaxval;
  21.  
  22.      Each ggggrrrraaaayyyy should contain only the values between 0000 and PPPPGGGGMMMM____MMMMAAAAXXXXMMMMAAAAXXXXVVVVAAAALLLL.
  23.      ppppggggmmmm____ppppbbbbmmmmmmmmaaaaxxxxvvvvaaaallll is the maxval used when a PGM program reads a PBM file.
  24.      Normally it is 1; however, for some programs, a larger value gives better
  25.      results.
  26.  
  27.      #define PGM_FORMAT ...
  28.      #define RPGM_FORMAT ...
  29.      #define PGM_TYPE PGM_FORMAT
  30.      int PGM_FORMAT_TYPE( int format )
  31.  
  32.      For distinguishing different file formats and types.
  33.  
  34.    IIIINNNNIIIITTTTIIIIAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN
  35.      void pgm_init( int* argcP, char* argv[] )
  36.  
  37.      All PGM programs must call this routine.
  38.  
  39.    MMMMEEEEMMMMOOOORRRRYYYY MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT
  40.      gray** pgm_allocarray( int cols, int rows )
  41.  
  42.      Allocate an array of grays.
  43.  
  44.      gray* pgm_allocrow( int cols )
  45.  
  46.      Allocate a row of the given number of grays.
  47.  
  48.      void pgm_freearray( gray** grays, int rows )
  49.  
  50.      Free the array allocated with ppppggggmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) containing the given
  51.      number of rows.
  52.  
  53.      void pgm_freerow( gray* grayrow )
  54.  
  55.      Free a row of grays.
  56.  
  57.    RRRREEEEAAAADDDDIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  58.      void pgm_readpgminit( FILE* fp, int* colsP, int* rowsP, gray* maxvalP, int* formatP )
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. lllliiiibbbbppppggggmmmm((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          lllliiiibbbbppppggggmmmm((((3333))))
  71.  
  72.  
  73.  
  74.      Read the header from a PGM file, filling in the rows, cols, maxval and
  75.      format variables.
  76.  
  77.      void pgm_readpgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int format )
  78.  
  79.      Read a row of grays into the grayrow array.  Format, cols, and maxval
  80.      were filled in by ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmiiiinnnniiiitttt(((()))).
  81.  
  82.      gray** pgm_readpgm( FILE* fp, int* colsP, int* rowsP, gray* maxvalP )
  83.  
  84.      Read an entire graymap file into memory, returning the allocated array
  85.      and filling in the rows, cols and maxval variables.  This function
  86.      combines ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmiiiinnnniiiitttt(((()))), ppppggggmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) and ppppggggmmmm____rrrreeeeaaaaddddppppggggmmmmrrrroooowwww(((()))).
  87.  
  88.    WWWWRRRRIIIITTTTIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  89.      void pgm_writepgminit( FILE* fp, int cols, int rows, gray maxval, int forceplain )
  90.  
  91.      Write the header for a portable graymap file.  The forceplain flag forces
  92.      a plain-format file to be written, as opposed to a raw-format one.
  93.  
  94.      void pgm_writepgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int forceplain )
  95.  
  96.      Write a row from a portable graymap.
  97.  
  98.      void pgm_writepgm( FILE* fp, gray** grays, int cols, int rows, gray maxval, int forceplain )
  99.  
  100.      Write the header and all data for a portable graymap.  This function
  101.      combines ppppggggmmmm____wwwwrrrriiiitttteeeeppppggggmmmmiiiinnnniiiitttt(((()))) and ppppggggmmmm____wwwwrrrriiiitttteeeeppppggggmmmmrrrroooowwww(((()))).
  102.  
  103. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  104.      libpbm(3), libppm(3), libpnm(3)
  105.  
  106. AAAAUUUUTTTTHHHHOOOORRRR
  107.      Copyright (C) 1989, 1991 by Tony Hansen and Jef Poskanzer.
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.